package com.ghc.controller;

import com.ghc.feign.ResumeFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/autodeliver")
public class AutodeliverController {

    @Autowired
    ResumeFeign resumeFeign;

    /*@RequestMapping("/checkState/{userId}")
    public Integer findResumeOpenState(@PathVariable Long userId){
        //远程调用简历微服务 RestTemplate
        return restTemplate.getForObject("http://localhost:8000/resume/openstate/" + userId, Integer.class);
    }*/
    @RequestMapping("/checkState/{userId}")
    public Integer findResumeOpenState(@PathVariable Long userId){
        //远程调用简历微服务 RestTemplate
        return resumeFeign.findDefaultResumeByUserId(userId);
    }

}
